export function getNumDisplay(num) {
  let {showNum, unit} = decondeNum(num);
  if (unit){
    return showNum + unit +'+';
  } else {
    return showNum;
  }
}

export function getNumShortDisplay(num){
  let {showNum, unit} = decondeNum(num);
  if (showNum>=1000){
    showNum =  parseInt(showNum/1000);
    unit = '千'+unit;
  }
  return showNum+unit;
}

function decondeNum(num){
  let unit = '';
  let showNum = num;
  if (showNum >= 10000){
    unit = '万';
    showNum = parseInt(showNum/10000);
  }
  if (showNum >= 10000){
    unit = '亿';
    showNum = parseInt(showNum/10000);
  }
  if (showNum >= 10000){
    unit = '兆';
    showNum = parseInt(showNum/10000);
  }
  return {showNum: showNum, unit: unit}
}